package com.itheima.practice;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;

public class JDK8Date01 {
    public static void main(String[] args) {
        LocalDateTime localDateTime = LocalDateTime.of(2020, 12, 12, 13, 14, 15);
        DateTimeFormatter pattern = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String format = localDateTime.format(pattern);
        System.out.println(format);

        LocalDateTime parse = LocalDateTime.parse("2020-12-12 13:14:15", pattern);
        System.out.println(parse);

    }
}
